<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1" />
<link rel="stylesheet" th:href="@{../layui/css/layui.css}" media="all" />
</head>
<body>
	<form id="reply_form" action="/mail/emailReply" method="post">
		<input type="hidden" name="mailType" th:value="${mail_type}"/>
		<input type="hidden" name="messageId" th:value="${message.id}"/>
	</form>
	
	<form id="forward_form" action="/mail/emailForward" method="post">
		<input type="hidden" name="mailType" th:value="${mail_type}"/>
		<input type="hidden" name="messageId" th:value="${message.id}"/>
	</form>
	
	<div>
		<div class="layui-row" style="background-color: white">
			<div class="layui-col-md12" style="padding: 1em 1em 0em 1em">
				发件人：<span th:text="${message.mailFrom}"></span>
				  <button class="layui-btn" style="margin-left:2rem;" onclick="reply()">回复</button>
				  <button class="layui-btn" style="margin-left:2rem;" onclick="forward()">转发</button>
			</div>
			<div class="layui-col-md12" style="padding: 1em 1em 0em 1em">
				收件人：<span th:text="${message.mailAddress}"></span>
			</div>
			
			<div th:if="${message.mailCopyto!=''}" class="layui-col-md12" style="padding: 1em 1em 0em 1em">
				抄送：<span th:text="${message.mailCopyto}"></span>
			</div>
			
			
			<div class="layui-col-md12" style="padding: 1em 1em 0em 1em">
				时<span> </span>间：<span th:text="${message.sentDate}"></span>
			</div>

			<div th:if="${message.hasAttachment == 'true' and not #strings.isEmpty(message.attachment)}">
				<div class="layui-col-md12" style="padding: 1em 1em 0em 1em"
					th:each="fujian:${#strings.arraySplit(message.attachment,',')}">
					附件： <a class="layui-btn demoMore" th:href="${fujian}"
						th:with="size=${#strings.arraySplit(fujian,'/').length-1}"
						th:text="${#strings.arraySplit(fujian,'/')[size]}" target="_blank"></a>
				</div>
			</div>
			<div class="layui-col-md12" style="padding: 1em 1em 0em 1em"
				th:utext="${message.bodyText}"></div>
		</div>
	</div>

	<script th:src="@{../plugin/testH/jquery.min.js?v=2.1.4}"></script>
	<script th:src="@{../layui/layui.js}" charset="utf-8"></script>
	<script th:src="@{../js/mail/email_detail.js}" charset="utf-8"></script>

</body>

</html>